package com.app.shop.demo;

import android.app.Application;

import com.app.shop.demo.beans.GoodsBean;
import com.app.shop.demo.beans.OrderBean;
import com.app.shop.mylibrary.utils.AppDir;
import com.app.shop.mylibrary.utils.FrescoUtil;

import org.litepal.LitePal;

import java.util.ArrayList;
import java.util.List;

/**
 * @anthor :
 * @description :
 */


public class   MyApplication extends Application {

    private static MyApplication instance;

    public static List<GoodsBean> goodsBeanList = new ArrayList<>();  //模拟购物车商品
    public static List<GoodsBean> orderDetailList = new ArrayList<>();  //订单商品
    public static List<OrderBean> orderList = new ArrayList<>();  //订单商品

    @Override
    public void onCreate() {
        super.onCreate();

        instance = this;
        if (instance != null) {

            //数据库初始化
            LitePal.initialize(instance);

            //创建应用缓存路径
            AppDir.getInstance(this);

            //fresco初始化
            FrescoUtil.init(instance);
        }
    }


    public static MyApplication getInstance() {
        return instance;
    }
}
